package com.turing.webosket;

import com.turing.webosket.common.OneToManyWebSocket;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@MapperScan("com.turing.webosket.mapper")
public class TuringWebsosketApplication {

    public static void main(String[] args) {
        //通过启动类获取SpringApplication
        SpringApplication springApplication = new SpringApplication(TuringWebsosketApplication.class);
        //通过启动类的运行获取ConfigurableApplicationContext
        ConfigurableApplicationContext configurableApplicationContext = springApplication.run(args);
        //解决WebSocket不能注入的问题
        OneToManyWebSocket.setTuringWebsosketApplication(configurableApplicationContext);
    }


}
